import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Cart from '../views/Cart.vue'
import Details from '../views/Details.vue'
import Seckill from '../views/Seckill.vue'
import Order from '../views/Order.vue'
import Item from '../views/Item.vue'
import Search from '../views/Search.vue'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/cart',
    name: 'Cart',
    component: Cart
  },
  {
    path: '/details/:id',
    name: 'Details',
    component: Details
  },
  {
    path: '/seckill',
    name: 'Seckill',
    component: Seckill
  },
  {
    path: '/order',
    name: 'Order',
    component: Order
  },
  {
    path: '/item',
    name: 'Item',
    component: Item
  },
  {
    path: '/search/:val',
    name: 'Search',
    component: Search
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  routes
})

export default router
